
import About from  "./components/about/about"
import Admin from  "./components/Admin"
import Home from  "./components/Home"
import Login from  "./components/Login"
import Menu from  "./components/Menu"
import Register from  "./components/Register"


// 二级路由
import Contact from  "./components/about/contact"
import Deliver from  "./components/about/Deliver"
import History from  "./components/about/Histoty"
import Order from  "./components/about/OrderGui"


export const routes = [
    {path:"/", name:"homeLink", components:{
        default:Home,
            contactLink:Contact,
            deliverLink:Deliver,
            historyLink:History,
        }},
    {path:"/about", name:"aboutLink",redirect:'/history',  component:About,children:[
            {path:"/history",name:"historyLink",component:History},
            {path:"/contact",name:"contactLink",component:Contact},
            {path:"/order",name:"orderLink",component:Order},
            {path:"/deliver",name:"deliverLink",component:Deliver}
        ]},
    {path:"/admin", name:"adminLink", component:Admin, beforeEnter: (to,from,next) =>{
            alert("非登录状态，不能进入此页面！");
            // next();
        }},
    {path:"/login", name:"loginLink", component:Login},
    {path:"/menu", name:"menuLink", component:Menu},
    {path:"/register", name:"registerLink", component:Register},
    {path:"*", redirect:'/'}
]
